package com.onerway.enums;

/**
 * ISO_3166-1
 */

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * ISO_3166-1
 */

@AllArgsConstructor
@Getter
public enum RegionInfoEnum {

    // 国家名称, ISO 3166-1 alpha-2代码, ISO 4217 货币代码
    AFGHANISTAN("阿富汗", "AF", "AFN"),
    ALBANIA("阿尔巴尼亚", "AL", "ALL"),
    ALGERIA("阿尔及利亚", "DZ", "DZD"),
    ANDORRA("安道尔", "AD", "EUR"),
    ANGOLA("安哥拉", "AO", "AOA"),
    ANTIGUA_AND_BARBUDA("安提瓜和巴布达", "AG", "XCD"),
    ARGENTINA("阿根廷", "AR", "ARS"),
    ARMENIA("亚美尼亚", "AM", "AMD"),
    AUSTRALIA("澳大利亚", "AU", "AUD"),
    AUSTRIA("奥地利", "AT", "EUR"),
    AZERBAIJAN("阿塞拜疆", "AZ", "AZN"),
    BAHAMAS("巴哈马", "BS", "BSD"),
    BAHRAIN("巴林", "BH", "BHD"),
    BANGLADESH("孟加拉国", "BD", "BDT"),
    BARBADOS("巴巴多斯", "BB", "BBD"),
    BELARUS("白俄罗斯", "BY", "BYN"),
    BELGIUM("比利时", "BE", "EUR"),
    BELIZE("伯利兹", "BZ", "BZD"),
    BENIN("贝宁", "BJ", "XOF"),
    BHUTAN("不丹", "BT", "BTN"),
    BOLIVIA("玻利维亚", "BO", "BOB"),
    BOSNIA_AND_HERZEGOVINA("波黑", "BA", "BAM"),
    BOTSWANA("博茨瓦纳", "BW", "BWP"),
    BRAZIL("巴西", "BR", "BRL"),
    BRUNEI("文莱", "BN", "BND"),
    BULGARIA("保加利亚", "BG", "BGN"),
    BURKINA_FASO("布基纳法索", "BF", "XOF"),
    BURUNDI("布隆迪", "BI", "BIF"),
    CAMBODIA("柬埔寨", "KH", "KHR"),
    CAMEROON("喀麦隆", "CM", "XAF"),
    CANADA("加拿大", "CA", "CAD"),
    CAPE_VERDE("佛得角", "CV", "CVE"),
    CENTRAL_AFRICAN_REPUBLIC("中非共和国", "CF", "XAF"),
    CHAD("乍得", "TD", "XAF"),
    CHILE("智利", "CL", "CLP"),
    CHINA("中国", "CN", "CNY"),
    COLOMBIA("哥伦比亚", "CO", "COP"),
    COMOROS("科摩罗", "KM", "KMF"),
    CONGO("刚果", "CG", "XAF"),
    CONGO_DEMOCRATIC_REPUBLIC("刚果民主共和国", "CD", "CDF"),
    COSTA_RICA("哥斯达黎加", "CR", "CRC"),
    CROATIA("克罗地亚", "HR", "EUR"),
    CUBA("古巴", "CU", "CUP"),
    CYPRUS("塞浦路斯", "CY", "EUR"),
    CZECH_REPUBLIC("捷克", "CZ", "CZK"),
    DENMARK("丹麦", "DK", "DKK"),
    DJIBOUTI("吉布提", "DJ", "DJF"),
    DOMINICA("多米尼克", "DM", "XCD"),
    DOMINICAN_REPUBLIC("多米尼加共和国", "DO", "DOP"),
    ECUADOR("厄瓜多尔", "EC", "USD"),
    EGYPT("埃及", "EG", "EGP"),
    EL_SALVADOR("萨尔瓦多", "SV", "USD"),
    EQUATORIAL_GUINEA("赤道几内亚", "GQ", "XAF"),
    ERITREA("厄立特里亚", "ER", "ERN"),
    ESTONIA("爱沙尼亚", "EE", "EUR"),
    ESWATINI("斯威士兰", "SZ", "SZL"),
    ETHIOPIA("埃塞俄比亚", "ET", "ETB"),
    FIJI("斐济", "FJ", "FJD"),
    FINLAND("芬兰", "FI", "EUR"),
    FRANCE("法国", "FR", "EUR"),
    GABON("加蓬", "GA", "XAF"),
    GAMBIA("冈比亚", "GM", "GMD"),
    GEORGIA("格鲁吉亚", "GE", "GEL"),
    GERMANY("德国", "DE", "EUR"),
    GHANA("加纳", "GH", "GHS"),
    GREECE("希腊", "GR", "EUR"),
    GRENADA("格林纳达", "GD", "XCD"),
    GUATEMALA("危地马拉", "GT", "GTQ"),
    GUINEA("几内亚", "GN", "GNF"),
    GUINEA_BISSAU("几内亚比绍", "GW", "XOF"),
    GUYANA("圭亚那", "GY", "GYD"),
    HAITI("海地", "HT", "HTG"),
    HONDURAS("洪都拉斯", "HN", "HNL"),
    HUNGARY("匈牙利", "HU", "HUF"),
    ICELAND("冰岛", "IS", "ISK"),
    INDIA("印度", "IN", "INR"),
    INDONESIA("印度尼西亚", "ID", "IDR"),
    IRAN("伊朗", "IR", "IRR"),
    IRAQ("伊拉克", "IQ", "IQD"),
    IRELAND("爱尔兰", "IE", "EUR"),
    ISRAEL("以色列", "IL", "ILS"),
    ITALY("意大利", "IT", "EUR"),
    JAMAICA("牙买加", "JM", "JMD"),
    JAPAN("日本", "JP", "JPY"),
    JORDAN("约旦", "JO", "JOD"),
    KAZAKHSTAN("哈萨克斯坦", "KZ", "KZT"),
    KENYA("肯尼亚", "KE", "KES"),
    KIRIBATI("基里巴斯", "KI", "AUD"),
    KOREA_NORTH("朝鲜", "KP", "KPW"),
    KOREA_SOUTH("韩国", "KR", "KRW"),
    KUWAIT("科威特", "KW", "KWD"),
    KYRGYZSTAN("吉尔吉斯斯坦", "KG", "KGS"),
    LAOS("老挝", "LA", "LAK"),
    LATVIA("拉脱维亚", "LV", "EUR"),
    LEBANON("黎巴嫩", "LB", "LBP"),
    LESOTHO("莱索托", "LS", "LSL"),
    LIBERIA("利比里亚", "LR", "LRD"),
    LIBYA("利比亚", "LY", "LYD"),
    LIECHTENSTEIN("列支敦士登", "LI", "CHF"),
    LITHUANIA("立陶宛", "LT", "EUR"),
    LUXEMBOURG("卢森堡", "LU", "EUR"),
    MADAGASCAR("马达加斯加", "MG", "MGA"),
    MALAWI("马拉维", "MW", "MWK"),
    MALAYSIA("马来西亚", "MY", "MYR"),
    MALDIVES("马尔代夫", "MV", "MVR"),
    MALI("马里", "ML", "XOF"),
    MALTA("马耳他", "MT", "EUR"),
    MARSHALL_ISLANDS("马绍尔群岛", "MH", "USD"),
    MAURITANIA("毛里塔尼亚", "MR", "MRU"),
    MAURITIUS("毛里求斯", "MU", "MUR"),
    MEXICO("墨西哥", "MX", "MXN"),
    MICRONESIA("密克罗尼西亚", "FM", "USD"),
    MOLDOVA("摩尔多瓦", "MD", "MDL"),
    MONACO("摩纳哥", "MC", "EUR"),
    MONGOLIA("蒙古", "MN", "MNT"),
    MONTENEGRO("黑山", "ME", "EUR"),
    MOROCCO("摩洛哥", "MA", "MAD"),
    MOZAMBIQUE("莫桑比克", "MZ", "MZN"),
    MYANMAR("缅甸", "MM", "MMK"),
    NAMIBIA("纳米比亚", "NA", "NAD"),
    NAURU("瑙鲁", "NR", "AUD"),
    NEPAL("尼泊尔", "NP", "NPR"),
    NETHERLANDS("荷兰", "NL", "EUR"),
    NEW_ZEALAND("新西兰", "NZ", "NZD"),
    NICARAGUA("尼加拉瓜", "NI", "NIO"),
    NIGER("尼日尔", "NE", "XOF"),
    NIGERIA("尼日利亚", "NG", "NGN"),
    NORWAY("挪威", "NO", "NOK"),
    OMAN("阿曼", "OM", "OMR"),
    PAKISTAN("巴基斯坦", "PK", "PKR"),
    PALAU("帕劳", "PW", "USD"),
    PANAMA("巴拿马", "PA", "PAB"),
    PAPUA_NEW_GUINEA("巴布亚新几内亚", "PG", "PGK"),
    PARAGUAY("巴拉圭", "PY", "PYG"),
    PERU("秘鲁", "PE", "PEN"),
    PHILIPPINES("菲律宾", "PH", "PHP"),
    POLAND("波兰", "PL", "PLN"),
    PORTUGAL("葡萄牙", "PT", "EUR"),
    QATAR("卡塔尔", "QA", "QAR"),
    ROMANIA("罗马尼亚", "RO", "RON"),
    RUSSIA("俄罗斯", "RU", "RUB"),
    RWANDA("卢旺达", "RW", "RWF"),
    SAINT_KITTS_AND_NEVIS("圣基茨和尼维斯", "KN", "XCD"),
    SAINT_LUCIA("圣卢西亚", "LC", "XCD"),
    SAINT_VINCENT_AND_GRENADINES("圣文森特和格林纳丁斯", "VC", "XCD"),
    SAMOA("萨摩亚", "WS", "WST"),
    SAN_MARINO("圣马力诺", "SM", "EUR"),
    SAO_TOME_AND_PRINCIPE("圣多美和普林西比", "ST", "STN"),
    SAUDI_ARABIA("沙特阿拉伯", "SA", "SAR"),
    SENEGAL("塞内加尔", "SN", "XOF"),
    SERBIA("塞尔维亚", "RS", "RSD"),
    SEYCHELLES("塞舌尔", "SC", "SCR"),
    SIERRA_LEONE("塞拉利昂", "SL", "SLL"),
    SINGAPORE("新加坡", "SG", "SGD"),
    SLOVAKIA("斯洛伐克", "SK", "EUR"),
    SLOVENIA("斯洛文尼亚", "SI", "EUR"),
    SOLOMON_ISLANDS("所罗门群岛", "SB", "SBD"),
    SOMALIA("索马里", "SO", "SOS"),
    SOUTH_AFRICA("南非", "ZA", "ZAR"),
    SOUTH_SUDAN("南苏丹", "SS", "SSP"),
    SPAIN("西班牙", "ES", "EUR"),
    SRI_LANKA("斯里兰卡", "LK", "LKR"),
    SUDAN("苏丹", "SD", "SDG"),
    SURINAME("苏里南", "SR", "SRD"),
    SWEDEN("瑞典", "SE", "SEK"),
    SWITZERLAND("瑞士", "CH", "CHF"),
    SYRIA("叙利亚", "SY", "SYP"),
    TAIWAN("台湾", "TW", "TWD"),
    TAJIKISTAN("塔吉克斯坦", "TJ", "TJS"),
    TANZANIA("坦桑尼亚", "TZ", "TZS"),
    THAILAND("泰国", "TH", "THB"),
    TIMOR_LESTE("东帝汶", "TL", "USD"),
    TOGO("多哥", "TG", "XOF"),
    TONGA("汤加", "TO", "TOP"),
    TRINIDAD_AND_TOBAGO("特立尼达和多巴哥", "TT", "TTD"),
    TUNISIA("突尼斯", "TN", "TND"),
    TURKEY("土耳其", "TR", "TRY"),
    TURKMENISTAN("土库曼斯坦", "TM", "TMT"),
    TUVALU("图瓦卢", "TV", "AUD"),
    UGANDA("乌干达", "UG", "UGX"),
    UKRAINE("乌克兰", "UA", "UAH"),
    UAE("阿联酋", "AE", "AED"),
    UK("英国", "GB", "GBP"),
    UNITED_STATES("美国", "US", "USD"),
    URUGUAY("乌拉圭", "UY", "UYU"),
    UZBEKISTAN("乌兹别克斯坦", "UZ", "UZS"),
    VANUATU("瓦努阿图", "VU", "VUV"),
    VATICAN_CITY("梵蒂冈", "VA", "EUR"),
    VENEZUELA("委内瑞拉", "VE", "VES"),
    VIETNAM("越南", "VN", "VND"),
    YEMEN("也门", "YE", "YER"),
    ZAMBIA("赞比亚", "ZM", "ZMW"),
    ZIMBABWE("津巴布韦", "ZW", "ZWL");

    private final String name;
    private final String code;
    private final String currencyCode;

    /**
     * 根据ISO 3166-1 alpha-2代码获取国家枚举对象
     * @param code 国家代码
     * @return CountryEnum 枚举对象
     */
    public static RegionInfoEnum fromCode(String code) {
        for (RegionInfoEnum country : values()) {
            if (country.getCode().equalsIgnoreCase(code)) {
                return country;
            }
        }
        throw new IllegalArgumentException("Invalid country code: " + code);
    }
}



